home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 August: Technology Seed / August 1998 ADC Seed CD.toast / Mac OS 8.5b2 / allegro-b2-pseudo-SDK / AIncludes / Menus.a < prev    next >
Encoding:
Text File  |  1998-07-17  |  32.8 KB  |  1,160 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        Menus.a
  3. ;
  4. ;    Contains:    Menu Manager Interfaces.
  5. ;
  6. ;    Version:    Technology:    Mac OS 8.1
  7. ;                Release:    Allego Seed, Use with 3.1 Universal Interfaces
  8. ;
  9. ;    Copyright:    © 1985-1998 by Apple Computer, Inc., all rights reserved.
  10. ;
  11. ;    Bugs?:        Please include the the file and version information (from above) with
  12. ;                the problem description.  Developers belonging to one of the Apple
  13. ;                developer programs can submit bug reports to:
  14. ;
  15. ;                    devsupport@apple.com
  16. ;
  17. ;
  18.     IF &TYPE('__MENUS__') = 'UNDEFINED' THEN
  19. __MENUS__ SET 1
  20.  
  21.     IF &TYPE('__APPLEEVENTS__') = 'UNDEFINED' THEN
  22.     include 'AppleEvents.a'
  23.     ENDIF
  24.     IF &TYPE('__CONDITIONALMACROS__') = 'UNDEFINED' THEN
  25.     include 'ConditionalMacros.a'
  26.     ENDIF
  27.     IF &TYPE('__EVENTS__') = 'UNDEFINED' THEN
  28.     include 'Events.a'
  29.     ENDIF
  30.     IF &TYPE('__PROCESSES__') = 'UNDEFINED' THEN
  31.     include 'Processes.a'
  32.     ENDIF
  33.     IF &TYPE('__TEXTCOMMON__') = 'UNDEFINED' THEN
  34.     include 'TextCommon.a'
  35.     ENDIF
  36.     IF &TYPE('__MACTYPES__') = 'UNDEFINED' THEN
  37.     include 'MacTypes.a'
  38.     ENDIF
  39.     IF &TYPE('__QUICKDRAW__') = 'UNDEFINED' THEN
  40.     include 'Quickdraw.a'
  41.     ENDIF
  42.  
  43. ; ——————————————————————————————————————————————————————————————————————————————————————
  44. ;     • Gestalt                                                                            
  45. ; ——————————————————————————————————————————————————————————————————————————————————————
  46.  
  47. gestaltMenuMgrAttr                EQU        'menu'                ; If this Gestalt exists, the PowerPC-native Menu Manager is installed
  48. gestaltMenuMgrPresent            EQU        1
  49.  
  50. menuPropertyInvalid                EQU        -5603
  51. menuPropertyNotFoundErr            EQU        -5604
  52. ; ——————————————————————————————————————————————————————————————————————————————————————
  53. ;     • Menu Types (for Appearance 1.0 and later)                                            
  54. ; ——————————————————————————————————————————————————————————————————————————————————————
  55.  
  56. kMenuStdMenuProc                EQU        63
  57. kMenuStdMenuBarProc                EQU        63
  58.  
  59. kMenuNoModifiers                EQU        0                    ; Mask for no modifiers
  60. kMenuShiftModifier                EQU        $01                    ; Mask for shift key modifier
  61. kMenuOptionModifier                EQU        $02                    ; Mask for option key modifier
  62. kMenuControlModifier            EQU        $04                    ; Mask for control key modifier
  63. kMenuNoCommandModifier            EQU        $08                    ; Mask for no command key modifier
  64.  
  65. kMenuNoIcon                        EQU        0                    ; No icon
  66. kMenuIconType                    EQU        1                    ; Type for ICON
  67. kMenuShrinkIconType                EQU        2                    ; Type for ICON plotted 16 x 16
  68. kMenuSmallIconType                EQU        3                    ; Type for SICN
  69. kMenuColorIconType                EQU        4                    ; Type for cicn
  70. kMenuIconSuiteType                EQU        5                    ; Type for Icon Suite
  71. kMenuIconRefType                EQU        6                    ; Type for Icon Ref
  72. ;  —— end of Appearance 1.0 types
  73.  
  74.  
  75. noMark                            EQU        0                    ;mark symbol for MarkItem
  76.  
  77.                                                             ; menu defProc messages 
  78. kMenuDrawMsg                    EQU        0
  79. kMenuChooseMsg                    EQU        1
  80. kMenuSizeMsg                    EQU        2
  81. kMenuDrawItemMsg                EQU        4
  82. kMenuCalcItemMsg                EQU        5
  83. kMenuThemeSavvyMsg                EQU        7                    ; is your MDEF theme-savvy?  If so, return hex 7473 in the whichItem parameter
  84. mDrawMsg                        EQU        0
  85. mChooseMsg                        EQU        1
  86. mSizeMsg                        EQU        2
  87. mDrawItemMsg                    EQU        4
  88. mCalcItemMsg                    EQU        5
  89.  
  90. kThemeSavvyMenuResponse            EQU        $7473
  91.  
  92. textMenuProc                    EQU        0
  93. hMenuCmd                        EQU        27                    ;itemCmd == 0x001B ==> hierarchical menu
  94. hierMenu                        EQU        -1                    ;a hierarchical menu - for InsertMenu call
  95. mPopUpMsg                        EQU        3                    ;menu defProc messages - place yourself
  96. mctAllItems                        EQU        -98                    ;search for all Items for the given ID
  97. mctLastIDIndic                    EQU        -99                    ;last color table entry has this in ID field
  98.  
  99. MenuInfo                RECORD 0
  100. menuID                     ds.w    1                ; offset: $0 (0)
  101. menuWidth                 ds.w    1                ; offset: $2 (2)
  102. menuHeight                 ds.w    1                ; offset: $4 (4)
  103. menuProc                 ds.l    1                ; offset: $6 (6)
  104. enableFlags                 ds.l    1                ; offset: $A (10)
  105. menuData                 ds        Str255            ; offset: $E (14)
  106. sizeof                     EQU *                    ; size:   $10E (270)
  107.                         ENDR
  108. ; typedef struct MenuInfo *                MenuPtr
  109.  
  110. ; typedef MenuPtr *                        MenuHandle
  111.  
  112. ;  MenuRef is obsolete.  Use MenuHandle. 
  113. ; typedef MenuHandle                     MenuRef
  114.  
  115. MCEntry                    RECORD 0
  116. mctID                     ds.w    1                ; offset: $0 (0)        ; menu ID.  ID = 0 is the menu bar
  117. mctItem                     ds.w    1                ; offset: $2 (2)        ; menu Item. Item = 0 is a title
  118. mctRGB1                     ds        RGBColor        ; offset: $4 (4)        ; usage depends on ID and Item
  119. mctRGB2                     ds        RGBColor        ; offset: $A (10)        ; usage depends on ID and Item
  120. mctRGB3                     ds        RGBColor        ; offset: $10 (16)        ; usage depends on ID and Item
  121. mctRGB4                     ds        RGBColor        ; offset: $16 (22)        ; usage depends on ID and Item
  122. mctReserved                 ds.w    1                ; offset: $1C (28)        ; reserved for internal use
  123. sizeof                     EQU *                    ; size:   $1E (30)
  124.                         ENDR
  125. ; typedef struct MCEntry *                MCEntryPtr
  126.  
  127. MCTable                    RECORD 0
  128. elements                 ds.b    1 * MCEntry.sizeof
  129. sizeof                     EQU *                    ; size:   $1E (30)
  130.                         ENDR
  131.  
  132.  
  133. ; typedef struct MCEntry *                MCTablePtr
  134.  
  135. ; typedef MCTablePtr *                    MCTableHandle
  136.  
  137. MenuCRsrc                RECORD 0
  138. numEntries                 ds.w    1                ; offset: $0 (0)        ; number of entries
  139. mcEntryRecs                 ds        MCTable            ; offset: $2 (2)        ; ARRAY [1..numEntries] of MCEntry
  140. sizeof                     EQU *                    ; size:   $20 (32)
  141.                         ENDR
  142. ; typedef struct MenuCRsrc *            MenuCRsrcPtr
  143.  
  144. ; typedef MenuCRsrcPtr *                MenuCRsrcHandle
  145.  
  146.     IF TARGET_OS_WIN32 THEN
  147. ;  QuickTime 3.0 
  148. MenuAccessKeyRec        RECORD 0
  149. count                     ds.w    1                ; offset: $0 (0)
  150. flags                     ds.l    1                ; offset: $2 (2)
  151. keys                     ds.b    1                ; offset: $6 (6) <-- really an array of length one
  152.                          ORG 8
  153. sizeof                     EQU *                    ; size:   $8 (8)
  154.                         ENDR
  155. ; typedef struct MenuAccessKeyRec *        MenuAccessKeyPtr
  156.  
  157. ; typedef MenuAccessKeyPtr *            MenuAccessKeyHandle
  158.  
  159. ;
  160. ; extern void SetMenuItemHotKey(MenuHandle menu, short itemID, char hotKey, long flags)
  161. ;
  162.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  163.         IMPORT_CFM_FUNCTION SetMenuItemHotKey
  164.     ENDIF
  165.  
  166.     ENDIF    ; TARGET_OS_WIN32
  167.  
  168. ;
  169. ; pascal short GetMBarHeight(void)
  170. ;
  171.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  172.         Macro
  173.         _GetMBarHeight        &dest=(sp)
  174.             move.w            $0BAA,&dest
  175.         EndM
  176.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  177.         IMPORT_CFM_FUNCTION GetMBarHeight
  178.     ENDIF
  179.  
  180. ;
  181. ; pascal void InitMenus(void )
  182. ;
  183.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  184.         _InitMenus:    OPWORD    $A930
  185.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  186.         IMPORT_CFM_FUNCTION InitMenus
  187.     ENDIF
  188.  
  189. ;
  190. ; pascal MenuHandle NewMenu(short menuID, ConstStr255Param menuTitle)
  191. ;
  192.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  193.         _NewMenu:    OPWORD    $A931
  194.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  195.         IMPORT_CFM_FUNCTION NewMenu
  196.     ENDIF
  197.  
  198. ;
  199. ; pascal MenuHandle GetMenu(short resourceID)
  200. ;
  201.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  202.         _GetMenu:    OPWORD    $A9BF
  203.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  204.         IMPORT_CFM_FUNCTION GetMenu
  205.     ENDIF
  206.  
  207. ;
  208. ; pascal void DisposeMenu(MenuHandle theMenu)
  209. ;
  210.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  211.         _DisposeMenu:    OPWORD    $A932
  212.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  213.         IMPORT_CFM_FUNCTION DisposeMenu
  214.     ENDIF
  215.  
  216. ;
  217. ; pascal void AppendMenu(MenuHandle menu, ConstStr255Param data)
  218. ;
  219.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  220.         _AppendMenu:    OPWORD    $A933
  221.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  222.         IMPORT_CFM_FUNCTION AppendMenu
  223.     ENDIF
  224.  
  225. ;
  226. ; pascal void InsertResMenu(MenuHandle theMenu, ResType theType, short afterItem)
  227. ;
  228.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  229.         _InsertResMenu:    OPWORD    $A951
  230.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  231.         IMPORT_CFM_FUNCTION InsertResMenu
  232.     ENDIF
  233.  
  234. ;
  235. ; pascal void InsertMenu(MenuHandle theMenu, short beforeID)
  236. ;
  237.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  238.         _InsertMenu:    OPWORD    $A935
  239.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  240.         IMPORT_CFM_FUNCTION InsertMenu
  241.     ENDIF
  242.  
  243. ;
  244. ; pascal void DeleteMenu(short menuID)
  245. ;
  246.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  247.         _DeleteMenu:    OPWORD    $A936
  248.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  249.         IMPORT_CFM_FUNCTION DeleteMenu
  250.     ENDIF
  251.  
  252. ;
  253. ; pascal void AppendResMenu(MenuHandle theMenu, ResType theType)
  254. ;
  255.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  256.         _AppendResMenu:    OPWORD    $A94D
  257.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  258.         IMPORT_CFM_FUNCTION AppendResMenu
  259.     ENDIF
  260.  
  261. ;
  262. ; pascal void InsertMenuItem(MenuHandle theMenu, ConstStr255Param itemString, short afterItem)
  263. ;
  264.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  265.         _InsertMenuItem:    OPWORD    $A826
  266.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  267.         IMPORT_CFM_FUNCTION InsertMenuItem
  268.     ENDIF
  269.  
  270. ;
  271. ; pascal void DeleteMenuItem(MenuHandle theMenu, short item)
  272. ;
  273.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  274.         _DeleteMenuItem:    OPWORD    $A952
  275.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  276.         IMPORT_CFM_FUNCTION DeleteMenuItem
  277.     ENDIF
  278.  
  279. ;
  280. ; pascal long MenuKey(CharParameter ch)
  281. ;
  282.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  283.         _MenuKey:    OPWORD    $A93E
  284.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  285.         IMPORT_CFM_FUNCTION MenuKey
  286.     ENDIF
  287.  
  288. ;
  289. ; pascal void HiliteMenu(short menuID)
  290. ;
  291.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  292.         _HiliteMenu:    OPWORD    $A938
  293.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  294.         IMPORT_CFM_FUNCTION HiliteMenu
  295.     ENDIF
  296.  
  297. ;
  298. ; pascal void SetMenuItemText(MenuHandle theMenu, short item, ConstStr255Param itemString)
  299. ;
  300.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  301.         _SetMenuItemText:    OPWORD    $A947
  302.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  303.         IMPORT_CFM_FUNCTION SetMenuItemText
  304.     ENDIF
  305.  
  306. ;
  307. ; pascal void GetMenuItemText(MenuHandle theMenu, short item, Str255 itemString)
  308. ;
  309.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  310.         _GetMenuItemText:    OPWORD    $A946
  311.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  312.         IMPORT_CFM_FUNCTION GetMenuItemText
  313.     ENDIF
  314.  
  315. ;
  316. ; pascal void SetItemMark(MenuHandle theMenu, short item, CharParameter markChar)
  317. ;
  318.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  319.         _SetItemMark:    OPWORD    $A944
  320.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  321.         IMPORT_CFM_FUNCTION SetItemMark
  322.     ENDIF
  323.  
  324. ;
  325. ; pascal void GetItemMark(MenuHandle theMenu, short item, CharParameter *markChar)
  326. ;
  327.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  328.         _GetItemMark:    OPWORD    $A943
  329.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  330.         IMPORT_CFM_FUNCTION GetItemMark
  331.     ENDIF
  332.  
  333. ;
  334. ; pascal void SetItemCmd(MenuHandle theMenu, short item, CharParameter cmdChar)
  335. ;
  336.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  337.         _SetItemCmd:    OPWORD    $A84F
  338.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  339.         IMPORT_CFM_FUNCTION SetItemCmd
  340.     ENDIF
  341.  
  342. ;
  343. ; pascal void GetItemCmd(MenuHandle theMenu, short item, CharParameter *cmdChar)
  344. ;
  345.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  346.         _GetItemCmd:    OPWORD    $A84E
  347.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  348.         IMPORT_CFM_FUNCTION GetItemCmd
  349.     ENDIF
  350.  
  351. ;
  352. ; pascal void SetItemIcon(MenuHandle theMenu, short item, short iconIndex)
  353. ;
  354.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  355.         _SetItemIcon:    OPWORD    $A940
  356.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  357.         IMPORT_CFM_FUNCTION SetItemIcon
  358.     ENDIF
  359.  
  360. ;
  361. ; pascal void GetItemIcon(MenuHandle theMenu, short item, short *iconIndex)
  362. ;
  363.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  364.         _GetItemIcon:    OPWORD    $A93F
  365.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  366.         IMPORT_CFM_FUNCTION GetItemIcon
  367.     ENDIF
  368.  
  369. ;
  370. ; pascal void SetItemStyle(MenuHandle theMenu, short item, StyleParameter chStyle)
  371. ;
  372.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  373.         _SetItemStyle:    OPWORD    $A942
  374.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  375.         IMPORT_CFM_FUNCTION SetItemStyle
  376.     ENDIF
  377.  
  378. ;
  379. ; pascal void GetItemStyle(MenuHandle theMenu, short item, Style *chStyle)
  380. ;
  381.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  382.         _GetItemStyle:    OPWORD    $A941
  383.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  384.         IMPORT_CFM_FUNCTION GetItemStyle
  385.     ENDIF
  386.  
  387. ;
  388. ; pascal MenuHandle GetMenuHandle(short menuID)
  389. ;
  390.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  391.         _GetMenuHandle:    OPWORD    $A949
  392.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  393.         IMPORT_CFM_FUNCTION GetMenuHandle
  394.     ENDIF
  395.  
  396. ;
  397. ; pascal void CalcMenuSize(MenuHandle theMenu)
  398. ;
  399.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  400.         _CalcMenuSize:    OPWORD    $A948
  401.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  402.         IMPORT_CFM_FUNCTION CalcMenuSize
  403.     ENDIF
  404.  
  405. ;
  406. ; pascal void DisableItem(MenuHandle theMenu, short item)
  407. ;
  408.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  409.         _DisableItem:    OPWORD    $A93A
  410.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  411.         IMPORT_CFM_FUNCTION DisableItem
  412.     ENDIF
  413.  
  414. ;
  415. ; pascal void EnableItem(MenuHandle theMenu, short item)
  416. ;
  417.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  418.         _EnableItem:    OPWORD    $A939
  419.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  420.         IMPORT_CFM_FUNCTION EnableItem
  421.     ENDIF
  422.  
  423. ;
  424. ; pascal void FlashMenuBar(short menuID)
  425. ;
  426.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  427.         _FlashMenuBar:    OPWORD    $A94C
  428.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  429.         IMPORT_CFM_FUNCTION FlashMenuBar
  430.     ENDIF
  431.  
  432. ;
  433. ; pascal long PopUpMenuSelect(MenuHandle menu, short top, short left, short popUpItem)
  434. ;
  435.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  436.         _PopUpMenuSelect:    OPWORD    $A80B
  437.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  438.         IMPORT_CFM_FUNCTION PopUpMenuSelect
  439.     ENDIF
  440.  
  441. ;
  442. ; pascal long MenuChoice(void )
  443. ;
  444.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  445.         _MenuChoice:    OPWORD    $AA66
  446.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  447.         IMPORT_CFM_FUNCTION MenuChoice
  448.     ENDIF
  449.  
  450. ;
  451. ; pascal void DeleteMCEntries(short menuID, short menuItem)
  452. ;
  453.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  454.         _DeleteMCEntries:    OPWORD    $AA60
  455.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  456.         IMPORT_CFM_FUNCTION DeleteMCEntries
  457.     ENDIF
  458.  
  459. ;
  460. ; pascal MCTableHandle GetMCInfo(void )
  461. ;
  462.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  463.         _GetMCInfo:    OPWORD    $AA61
  464.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  465.         IMPORT_CFM_FUNCTION GetMCInfo
  466.     ENDIF
  467.  
  468. ;
  469. ; pascal void SetMCInfo(MCTableHandle menuCTbl)
  470. ;
  471.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  472.         _SetMCInfo:    OPWORD    $AA62
  473.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  474.         IMPORT_CFM_FUNCTION SetMCInfo
  475.     ENDIF
  476.  
  477. ;
  478. ; pascal void DisposeMCInfo(MCTableHandle menuCTbl)
  479. ;
  480.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  481.         _DisposeMCInfo:    OPWORD    $AA63
  482.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  483.         IMPORT_CFM_FUNCTION DisposeMCInfo
  484.     ENDIF
  485.  
  486. ;
  487. ; pascal MCEntryPtr GetMCEntry(short menuID, short menuItem)
  488. ;
  489.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  490.         _GetMCEntry:    OPWORD    $AA64
  491.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  492.         IMPORT_CFM_FUNCTION GetMCEntry
  493.     ENDIF
  494.  
  495. ;
  496. ; pascal void SetMCEntries(short numEntries, MCTablePtr menuCEntries)
  497. ;
  498.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  499.         _SetMCEntries:    OPWORD    $AA65
  500.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  501.         IMPORT_CFM_FUNCTION SetMCEntries
  502.     ENDIF
  503.  
  504. ;
  505. ; pascal void DrawMenuBar(void )
  506. ;
  507.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  508.         _DrawMenuBar:    OPWORD    $A937
  509.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  510.         IMPORT_CFM_FUNCTION DrawMenuBar
  511.     ENDIF
  512.  
  513. ;
  514. ; pascal void InvalMenuBar(void )
  515. ;
  516.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  517.         _InvalMenuBar:    OPWORD    $A81D
  518.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  519.         IMPORT_CFM_FUNCTION InvalMenuBar
  520.     ENDIF
  521.  
  522. ;
  523. ; pascal void InitProcMenu(short resID)
  524. ;
  525.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  526.         _InitProcMenu:    OPWORD    $A808
  527.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  528.         IMPORT_CFM_FUNCTION InitProcMenu
  529.     ENDIF
  530.  
  531. ;
  532. ; pascal Handle GetMenuBar(void )
  533. ;
  534.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  535.         _GetMenuBar:    OPWORD    $A93B
  536.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  537.         IMPORT_CFM_FUNCTION GetMenuBar
  538.     ENDIF
  539.  
  540. ;
  541. ; pascal void SetMenuBar(Handle menuList)
  542. ;
  543.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  544.         _SetMenuBar:    OPWORD    $A93C
  545.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  546.         IMPORT_CFM_FUNCTION SetMenuBar
  547.     ENDIF
  548.  
  549. ;
  550. ; pascal Boolean SystemEdit(short editCmd)
  551. ;
  552.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  553.         _SystemEdit:    OPWORD    $A9C2
  554.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  555.         IMPORT_CFM_FUNCTION SystemEdit
  556.     ENDIF
  557.  
  558. ;
  559. ; pascal void SystemMenu(long menuResult)
  560. ;
  561.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  562.         _SystemMenu:    OPWORD    $A9B5
  563.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  564.         IMPORT_CFM_FUNCTION SystemMenu
  565.     ENDIF
  566.  
  567. ;
  568. ; pascal Handle GetNewMBar(short menuBarID)
  569. ;
  570.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  571.         _GetNewMBar:    OPWORD    $A9C0
  572.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  573.         IMPORT_CFM_FUNCTION GetNewMBar
  574.     ENDIF
  575.  
  576. ;
  577. ; pascal void ClearMenuBar(void )
  578. ;
  579.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  580.         _ClearMenuBar:    OPWORD    $A934
  581.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  582.         IMPORT_CFM_FUNCTION ClearMenuBar
  583.     ENDIF
  584.  
  585. ;
  586. ; pascal void CheckItem(MenuHandle theMenu, short item, Boolean checked)
  587. ;
  588.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  589.         _CheckItem:    OPWORD    $A945
  590.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  591.         IMPORT_CFM_FUNCTION CheckItem
  592.     ENDIF
  593.  
  594. ;
  595. ; pascal short CountMItems(MenuHandle theMenu)
  596. ;
  597.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  598.         _CountMItems:    OPWORD    $A950
  599.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  600.         IMPORT_CFM_FUNCTION CountMItems
  601.     ENDIF
  602.  
  603. ;
  604. ; pascal void SetMenuFlash(short count)
  605. ;
  606.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  607.         _SetMenuFlash:    OPWORD    $A94A
  608.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  609.         IMPORT_CFM_FUNCTION SetMenuFlash
  610.     ENDIF
  611.  
  612. ;
  613. ; pascal long MenuSelect(Point startPt)
  614. ;
  615.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  616.         _MenuSelect:    OPWORD    $A93D
  617.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  618.         IMPORT_CFM_FUNCTION MenuSelect
  619.     ENDIF
  620.  
  621. ;
  622. ; pascal void InsertFontResMenu(MenuHandle theMenu, short afterItem, short scriptFilter)
  623. ;
  624.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  625.         Macro
  626.         _InsertFontResMenu
  627.             move.w              #$0400,D0
  628.             dc.w                $A825
  629.         EndM
  630.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  631.         IMPORT_CFM_FUNCTION InsertFontResMenu
  632.     ENDIF
  633.  
  634. ;
  635. ; pascal void InsertIntlResMenu(MenuHandle theMenu, ResType theType, short afterItem, short scriptFilter)
  636. ;
  637.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  638.         Macro
  639.         _InsertIntlResMenu
  640.             move.w              #$0601,D0
  641.             dc.w                $A825
  642.         EndM
  643.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  644.         IMPORT_CFM_FUNCTION InsertIntlResMenu
  645.     ENDIF
  646.  
  647.  
  648. ; ——————————————————————————————————————————————————————————————————————————————————————
  649. ;     • Appearance 1.0 and later Menu Manager routines                                    
  650. ; ——————————————————————————————————————————————————————————————————————————————————————
  651. ;
  652. ; pascal UInt32 MenuEvent(const EventRecord *inEvent)
  653. ;
  654.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  655.         Macro
  656.         _MenuEvent
  657.             move.w              #$020C,D0
  658.             dc.w                $A825
  659.         EndM
  660.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  661.         IMPORT_CFM_FUNCTION MenuEvent
  662.     ENDIF
  663.  
  664. ;
  665. ; pascal OSErr SetMenuItemCommandID(MenuHandle inMenu, SInt16 inItem, UInt32 inCommandID)
  666. ;
  667.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  668.         Macro
  669.         _SetMenuItemCommandID
  670.             move.w              #$0502,D0
  671.             dc.w                $A825
  672.         EndM
  673.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  674.         IMPORT_CFM_FUNCTION SetMenuItemCommandID
  675.     ENDIF
  676.  
  677. ;
  678. ; pascal OSErr GetMenuItemCommandID(MenuHandle inMenu, SInt16 inItem, UInt32 *outCommandID)
  679. ;
  680.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  681.         Macro
  682.         _GetMenuItemCommandID
  683.             move.w              #$0503,D0
  684.             dc.w                $A825
  685.         EndM
  686.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  687.         IMPORT_CFM_FUNCTION GetMenuItemCommandID
  688.     ENDIF
  689.  
  690. ;
  691. ; pascal OSErr SetMenuItemModifiers(MenuHandle inMenu, SInt16 inItem, UInt8 inModifiers)
  692. ;
  693.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  694.         Macro
  695.         _SetMenuItemModifiers
  696.             move.w              #$0404,D0
  697.             dc.w                $A825
  698.         EndM
  699.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  700.         IMPORT_CFM_FUNCTION SetMenuItemModifiers
  701.     ENDIF
  702.  
  703. ;
  704. ; pascal OSErr GetMenuItemModifiers(MenuHandle inMenu, SInt16 inItem, UInt8 *outModifiers)
  705. ;
  706.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  707.         Macro
  708.         _GetMenuItemModifiers
  709.             move.w              #$0505,D0
  710.             dc.w                $A825
  711.         EndM
  712.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  713.         IMPORT_CFM_FUNCTION GetMenuItemModifiers
  714.     ENDIF
  715.  
  716. ;
  717. ; pascal OSErr SetMenuItemIconHandle(MenuHandle inMenu, SInt16 inItem, UInt8 inIconType, Handle inIconHandle)
  718. ;
  719.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  720.         Macro
  721.         _SetMenuItemIconHandle
  722.             move.w              #$0606,D0
  723.             dc.w                $A825
  724.         EndM
  725.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  726.         IMPORT_CFM_FUNCTION SetMenuItemIconHandle
  727.     ENDIF
  728.  
  729. ;
  730. ; pascal OSErr GetMenuItemIconHandle(MenuHandle inMenu, SInt16 inItem, UInt8 *outIconType, Handle *outIconHandle)
  731. ;
  732.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  733.         Macro
  734.         _GetMenuItemIconHandle
  735.             move.w              #$0707,D0
  736.             dc.w                $A825
  737.         EndM
  738.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  739.         IMPORT_CFM_FUNCTION GetMenuItemIconHandle
  740.     ENDIF
  741.  
  742. ;
  743. ; pascal OSErr SetMenuItemTextEncoding(MenuHandle inMenu, SInt16 inItem, TextEncoding inScriptID)
  744. ;
  745.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  746.         Macro
  747.         _SetMenuItemTextEncoding
  748.             move.w              #$0408,D0
  749.             dc.w                $A825
  750.         EndM
  751.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  752.         IMPORT_CFM_FUNCTION SetMenuItemTextEncoding
  753.     ENDIF
  754.  
  755. ;
  756. ; pascal OSErr GetMenuItemTextEncoding(MenuHandle inMenu, SInt16 inItem, TextEncoding *outScriptID)
  757. ;
  758.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  759.         Macro
  760.         _GetMenuItemTextEncoding
  761.             move.w              #$0509,D0
  762.             dc.w                $A825
  763.         EndM
  764.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  765.         IMPORT_CFM_FUNCTION GetMenuItemTextEncoding
  766.     ENDIF
  767.  
  768. ;
  769. ; pascal OSErr SetMenuItemHierarchicalID(MenuHandle inMenu, SInt16 inItem, SInt16 inHierID)
  770. ;
  771.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  772.         Macro
  773.         _SetMenuItemHierarchicalID
  774.             move.w              #$040D,D0
  775.             dc.w                $A825
  776.         EndM
  777.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  778.         IMPORT_CFM_FUNCTION SetMenuItemHierarchicalID
  779.     ENDIF
  780.  
  781. ;
  782. ; pascal OSErr GetMenuItemHierarchicalID(MenuHandle inMenu, SInt16 inItem, SInt16 *outHierID)
  783. ;
  784.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  785.         Macro
  786.         _GetMenuItemHierarchicalID
  787.             move.w              #$050E,D0
  788.             dc.w                $A825
  789.         EndM
  790.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  791.         IMPORT_CFM_FUNCTION GetMenuItemHierarchicalID
  792.     ENDIF
  793.  
  794. ;
  795. ; pascal OSErr SetMenuItemFontID(MenuHandle inMenu, SInt16 inItem, SInt16 inFontID)
  796. ;
  797.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  798.         Macro
  799.         _SetMenuItemFontID
  800.             move.w              #$040F,D0
  801.             dc.w                $A825
  802.         EndM
  803.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  804.         IMPORT_CFM_FUNCTION SetMenuItemFontID
  805.     ENDIF
  806.  
  807. ;
  808. ; pascal OSErr GetMenuItemFontID(MenuHandle inMenu, SInt16 inItem, SInt16 *outFontID)
  809. ;
  810.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  811.         Macro
  812.         _GetMenuItemFontID
  813.             move.w              #$0510,D0
  814.             dc.w                $A825
  815.         EndM
  816.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  817.         IMPORT_CFM_FUNCTION GetMenuItemFontID
  818.     ENDIF
  819.  
  820. ;
  821. ; pascal OSErr SetMenuItemRefCon(MenuHandle inMenu, SInt16 inItem, UInt32 inRefCon)
  822. ;
  823.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  824.         Macro
  825.         _SetMenuItemRefCon
  826.             move.w              #$050A,D0
  827.             dc.w                $A825
  828.         EndM
  829.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  830.         IMPORT_CFM_FUNCTION SetMenuItemRefCon
  831.     ENDIF
  832.  
  833. ;
  834. ; pascal OSErr GetMenuItemRefCon(MenuHandle inMenu, SInt16 inItem, UInt32 *outRefCon)
  835. ;
  836.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  837.         Macro
  838.         _GetMenuItemRefCon
  839.             move.w              #$050B,D0
  840.             dc.w                $A825
  841.         EndM
  842.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  843.         IMPORT_CFM_FUNCTION GetMenuItemRefCon
  844.     ENDIF
  845.  
  846. ;
  847. ; pascal OSErr SetMenuItemRefCon2(MenuHandle inMenu, SInt16 inItem, UInt32 inRefCon2)
  848. ;
  849.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  850.         Macro
  851.         _SetMenuItemRefCon2
  852.             move.w              #$0511,D0
  853.             dc.w                $A825
  854.         EndM
  855.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  856.         IMPORT_CFM_FUNCTION SetMenuItemRefCon2
  857.     ENDIF
  858.  
  859. ;
  860. ; pascal OSErr GetMenuItemRefCon2(MenuHandle inMenu, SInt16 inItem, UInt32 *outRefCon2)
  861. ;
  862.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  863.         Macro
  864.         _GetMenuItemRefCon2
  865.             move.w              #$0512,D0
  866.             dc.w                $A825
  867.         EndM
  868.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  869.         IMPORT_CFM_FUNCTION GetMenuItemRefCon2
  870.     ENDIF
  871.  
  872. ;
  873. ; pascal OSErr SetMenuItemKeyGlyph(MenuHandle inMenu, SInt16 inItem, SInt16 inGlyph)
  874. ;
  875.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  876.         Macro
  877.         _SetMenuItemKeyGlyph
  878.             move.w              #$0513,D0
  879.             dc.w                $A825
  880.         EndM
  881.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  882.         IMPORT_CFM_FUNCTION SetMenuItemKeyGlyph
  883.     ENDIF
  884.  
  885. ;
  886. ; pascal OSErr GetMenuItemKeyGlyph(MenuHandle inMenu, SInt16 inItem, SInt16 *outGlyph)
  887. ;
  888.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  889.         Macro
  890.         _GetMenuItemKeyGlyph
  891.             move.w              #$0514,D0
  892.             dc.w                $A825
  893.         EndM
  894.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  895.         IMPORT_CFM_FUNCTION GetMenuItemKeyGlyph
  896.     ENDIF
  897.  
  898. ; ——————————————————————————————————————————————————————————————————————————————————————
  899. ;     • Appearance 1.1 and later Menu Manager routines                                    
  900. ; ——————————————————————————————————————————————————————————————————————————————————————
  901. ; ——————————————————————————————————————————————————————————————————————————————————————
  902. ;  • Properties                                                                            
  903. ; ——————————————————————————————————————————————————————————————————————————————————————
  904. ;  With the following property APIs, you can attach any piece of data you'd like to a    
  905. ;  menu or menu item. Passing zero for the item number parameter indicates you'd like    
  906. ;  to attach the data to the menu itself, and not to any specific menu item.            
  907. ;
  908. ; pascal OSStatus GetMenuItemProperty(MenuHandle menu, UInt16 item, OSType propertyCreator, OSType propertyTag, UInt32 bufferSize, UInt32 *actualSize, void *propertyBuffer)
  909. ;
  910.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  911.         IMPORT_CFM_FUNCTION GetMenuItemProperty
  912.     ENDIF
  913.  
  914. ;
  915. ; pascal OSStatus GetMenuItemPropertySize(MenuHandle menu, UInt16 item, OSType propertyCreator, OSType propertyTag, UInt32 *size)
  916. ;
  917.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  918.         IMPORT_CFM_FUNCTION GetMenuItemPropertySize
  919.     ENDIF
  920.  
  921. ;
  922. ; pascal OSStatus SetMenuItemProperty(MenuHandle menu, UInt16 item, OSType propertyCreator, OSType propertyTag, UInt32 propertySize, void *propertyData)
  923. ;
  924.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  925.         IMPORT_CFM_FUNCTION SetMenuItemProperty
  926.     ENDIF
  927.  
  928. ;
  929. ; pascal OSStatus RemoveMenuItemProperty(MenuHandle menu, UInt16 item, OSType propertyCreator, OSType propertyTag)
  930. ;
  931.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  932.         IMPORT_CFM_FUNCTION RemoveMenuItemProperty
  933.     ENDIF
  934.  
  935.  
  936. ; ——————————————————————————————————————————————————————————————————————————————————————
  937. ;  • item enabling routines supporting > 31 items                                                                            
  938. ; ——————————————————————————————————————————————————————————————————————————————————————
  939. ;  IsMenuItemEnabled works for items enabled with either Enable/DisableMenuItem and Enable/DisableItem
  940.  
  941. ;
  942. ; pascal void EnableMenuItem(MenuHandle theMenu, UInt16 item)
  943. ;
  944.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  945.         IMPORT_CFM_FUNCTION EnableMenuItem
  946.     ENDIF
  947.  
  948. ;
  949. ; pascal void DisableMenuItem(MenuHandle theMenu, UInt16 item)
  950. ;
  951.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  952.         IMPORT_CFM_FUNCTION DisableMenuItem
  953.     ENDIF
  954.  
  955. ;
  956. ; pascal Boolean IsMenuItemEnabled(MenuHandle menu, UInt16 item)
  957. ;
  958.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  959.         IMPORT_CFM_FUNCTION IsMenuItemEnabled
  960.     ENDIF
  961.  
  962.  
  963. ;   item icon enabling routines allowing icons to be dimmed
  964. ;   the item’s main enable state itself does not change
  965. ;   if the item is disabled, the icon will appear to be disabled
  966.  
  967.  
  968. ;
  969. ; pascal void EnableMenuItemIcon(MenuHandle theMenu, UInt16 item)
  970. ;
  971.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  972.         Macro
  973.         _EnableMenuItemIcon
  974.             move.w              #$0019,D0
  975.             dc.w                $A825
  976.         EndM
  977.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  978.         IMPORT_CFM_FUNCTION EnableMenuItemIcon
  979.     ENDIF
  980.  
  981. ;
  982. ; pascal void DisableMenuItemIcon(MenuHandle theMenu, UInt16 item)
  983. ;
  984.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  985.         Macro
  986.         _DisableMenuItemIcon
  987.             move.w              #$0020,D0
  988.             dc.w                $A825
  989.         EndM
  990.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  991.         IMPORT_CFM_FUNCTION DisableMenuItemIcon
  992.     ENDIF
  993.  
  994. ;
  995. ; pascal Boolean IsMenuItemIconEnabled(MenuHandle menu, UInt16 item)
  996. ;
  997.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  998.         Macro
  999.         _IsMenuItemIconEnabled
  1000.             move.w              #$0018,D0
  1001.             dc.w                $A825
  1002.         EndM
  1003.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1004.         IMPORT_CFM_FUNCTION IsMenuItemIconEnabled
  1005.     ENDIF
  1006.  
  1007. ;  menu bar visibility routines
  1008. ;
  1009. ; pascal Boolean IsMenuBarVisible(void )
  1010. ;
  1011.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1012.         IMPORT_CFM_FUNCTION IsMenuBarVisible
  1013.     ENDIF
  1014.  
  1015. ;
  1016. ; pascal void ShowMenuBar(void )
  1017. ;
  1018.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1019.         IMPORT_CFM_FUNCTION ShowMenuBar
  1020.     ENDIF
  1021.  
  1022. ;
  1023. ; pascal void HideMenuBar(void )
  1024. ;
  1025.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1026.         IMPORT_CFM_FUNCTION HideMenuBar
  1027.     ENDIF
  1028.  
  1029. ;  AppendMenuItemText and InsertMenuItemText is used to add a single menu item     
  1030. ;  without doing any meta-character interpretation 
  1031. ;
  1032. ; pascal OSStatus AppendMenuItemText(MenuHandle menu, ConstStr255Param inString)
  1033. ;
  1034.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1035.         IMPORT_CFM_FUNCTION AppendMenuItemText
  1036.     ENDIF
  1037.  
  1038. ;
  1039. ; pascal OSStatus InsertMenuItemText(MenuHandle menu, ConstStr255Param inString, UInt16 afterItem)
  1040. ;
  1041.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1042.         IMPORT_CFM_FUNCTION InsertMenuItemText
  1043.     ENDIF
  1044.  
  1045. ;  Get/SetMenuFont are used to save/restore the font used for drawing menus.    
  1046. ;
  1047. ; pascal OSStatus GetMenuFont(MenuHandle menu, SInt16 *outFontID, UInt16 *outFontSize)
  1048. ;
  1049.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1050.         IMPORT_CFM_FUNCTION GetMenuFont
  1051.     ENDIF
  1052.  
  1053. ;
  1054. ; pascal OSStatus SetMenuFont(MenuHandle menu, SInt16 inFontID, UInt16 inFontSize)
  1055. ;
  1056.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1057.         IMPORT_CFM_FUNCTION SetMenuFont
  1058.     ENDIF
  1059.  
  1060. ; ——————————————————————————————————————————————————————————————————————————————————————
  1061. ;     • Menu Width Modifiers                                                                
  1062. ; ——————————————————————————————————————————————————————————————————————————————————————
  1063. ;
  1064. ; pascal Boolean GetMenuExcludesMarkColumn(MenuHandle menu)
  1065. ;
  1066.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1067.         IMPORT_CFM_FUNCTION GetMenuExcludesMarkColumn
  1068.     ENDIF
  1069.  
  1070. ;
  1071. ; pascal OSStatus SetMenuExcludesMarkColumn(MenuHandle menu, Boolean excludesMark)
  1072. ;
  1073.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1074.         IMPORT_CFM_FUNCTION SetMenuExcludesMarkColumn
  1075.     ENDIF
  1076.  
  1077. ; ——————————————————————————————————————————————————————————————————————————————————————
  1078. ;     • Contextual Menu routines and constants                                            
  1079. ;     available with Conxtextual Menu extension 1.0 and later                                
  1080. ; ——————————————————————————————————————————————————————————————————————————————————————
  1081. ;  Gestalt Selector for classic 68K apps only. 
  1082. ;  CFM apps should weak link and check the symbols. 
  1083.  
  1084. gestaltContextualMenuAttr        EQU        'cmnu'
  1085. gestaltContextualMenuUnusedBit    EQU        0
  1086. gestaltContextualMenuTrapAvailable EQU    1
  1087. ;  Values indicating what kind of help the application supports 
  1088.  
  1089. kCMHelpItemNoHelp                EQU        0
  1090. kCMHelpItemAppleGuide            EQU        1
  1091. kCMHelpItemOtherHelp            EQU        2
  1092. ;  Values indicating what was chosen from the menu 
  1093.  
  1094. kCMNothingSelected                EQU        0
  1095. kCMMenuItemSelected                EQU        1
  1096. kCMShowHelpSelected                EQU        3
  1097. ;
  1098. ; pascal OSStatus InitContextualMenus(void )
  1099. ;
  1100.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1101.         Macro
  1102.         _InitContextualMenus
  1103.             moveq               #1,D0
  1104.             dc.w                $AA72
  1105.         EndM
  1106.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1107.         IMPORT_CFM_FUNCTION InitContextualMenus
  1108.     ENDIF
  1109.  
  1110. ;
  1111. ; pascal Boolean IsShowContextualMenuClick(const EventRecord *inEvent)
  1112. ;
  1113.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1114.         Macro
  1115.         _IsShowContextualMenuClick
  1116.             moveq               #2,D0
  1117.             dc.w                $AA72
  1118.         EndM
  1119.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1120.         IMPORT_CFM_FUNCTION IsShowContextualMenuClick
  1121.     ENDIF
  1122.  
  1123. ;
  1124. ; pascal OSStatus ContextualMenuSelect(MenuHandle inMenu, Point inGlobalLocation, Boolean inReserved, UInt32 inHelpType, ConstStr255Param inHelpItemString, const AEDesc *inSelection, UInt32 *outUserSelectionType, SInt16 *outMenuID, UInt16 *outMenuItem)
  1125. ;
  1126.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1127.         Macro
  1128.         _ContextualMenuSelect
  1129.             moveq               #3,D0
  1130.             dc.w                $AA72
  1131.         EndM
  1132.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1133.         IMPORT_CFM_FUNCTION ContextualMenuSelect
  1134.     ENDIF
  1135.  
  1136. ;
  1137. ; pascal Boolean ProcessIsContextualMenuClient(ProcessSerialNumber *inPSN)
  1138. ;
  1139.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1140.         Macro
  1141.         _ProcessIsContextualMenuClient
  1142.             moveq               #4,D0
  1143.             dc.w                $AA72
  1144.         EndM
  1145.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1146.         IMPORT_CFM_FUNCTION ProcessIsContextualMenuClient
  1147.     ENDIF
  1148.  
  1149.  
  1150.  
  1151.  
  1152.     IF OLDROUTINENAMES THEN
  1153.     ENDIF    ; OLDROUTINENAMES
  1154.  
  1155.  
  1156.     IF TARGET_OS_WIN32 THEN
  1157.     ENDIF    ; TARGET_OS_WIN32
  1158.     ENDIF ; __MENUS__ 
  1159.  
  1160.